/*
 * Copyright (c) 2016 Qualcomm Technologies, Inc.
 * All Rights Reserved.
 * Qualcomm Technologies, Inc. Confidential and Proprietary.
 */
package com.thunder.rebot.rebotclient.vam.ui;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;

import com.thunder.rebot.rebotclient.vam.Algo;
import com.thunder.rebot.rebotclient.vam.entity.FaceFrame;
import com.thunder.rebot.rebotclient.vam.entity.MapperParams;

import java.util.ArrayList;

/**
 * Class for enroll data drawable
 */
public class DataDrawable extends Drawable {
    private static final String TAG = DataDrawable.class.getSimpleName();

    protected final FrFramesUI frFramesUI;

    /**
     * Constructor for the Face enrollment guide class
     *
     * @param context application context
     * @param matcher   face matcher
     */
    public DataDrawable(Context context, Algo.FaceMatcher matcher) {
        frFramesUI = new FrFramesUI(context.getResources(), this);
    }

    /**
     * method to set the enroll Frame listener
     *
     * @param
     */
    public void setEnrollFramesUIListener() {

    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void onBoundsChange(Rect bounds) {

    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void draw(Canvas canvas) {
        frFramesUI.draw(canvas);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void setAlpha(int alpha) {
        frFramesUI.setAlpha(alpha);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void setColorFilter(ColorFilter filter) {
        frFramesUI.setColorFilter(filter);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int getOpacity() {
        return PixelFormat.TRANSLUCENT;
    }

    /**
     * method to reset the guide
     */
    public void reset() {
        frFramesUI.reset();
        invalidateSelf();
    }

    /**
     * Sets the new frames for the faces on the image
     *
     * @param imageFaceFrames face rectangles
     * @param params          mapper params
     */
    public void addFrames(ArrayList<FaceFrame> imageFaceFrames, MapperParams params) {
        frFramesUI.addFrames(imageFaceFrames, params);
    }

}
